import {Modal} from 'antd'

export const errModal = ((options) => {
  let modal = null
  return (options) => {
    if (!modal) {
      modal = Modal.error({
        ...options,
        onOk: () => {
          modal = null
          options.onOk && options.onOk()
        },
      })
    }
  }
})()
